

package com.hazelcast.internal.jmx.suppliers;

import com.hazelcast.collection.IList;
import com.hazelcast.collection.LocalCollectionStats;
import com.hazelcast.internal.monitor.impl.LocalListStatsImpl;

/**
 * Implementation of {@link StatsSupplier} for {@link IList}
 */
public class LocalListStatsSupplier implements StatsSupplier<LocalCollectionStats> {

    private final IList list;

    public LocalListStatsSupplier(IList list) {
        this.list = list;
    }

    @Override
    public LocalCollectionStats getEmpty() {
        return new LocalListStatsImpl();
    }

    @Override
    public LocalCollectionStats get() {
        return list.getLocalListStats();
    }
}
